package com.example.demo_test.Dao;

import com.example.demo_test.Entity.Page;
import com.example.demo_test.Entity.ReqRecord;
import com.example.demo_test.Entity.Result;
import com.example.demo_test.Entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @author zhanghong
 * @date 2021/4/9  0009 17:37
 */
@Mapper
public interface PersonDao {
    User Login(@Param( "userId" ) String userId, @Param( "password" ) String password);
    List<User> getFriends(@Param( "userId") String userId);
    List<User> getGroupUsers(@Param( "groupId" )int groupId);

    User getUserById(@Param( "userId" ) String userId);
    void addReqRecord(@Param( "reqRecord" )ReqRecord reqRecord);

    List<ReqRecord> getReqRecordById(String userId);
    void updateReqRecord(@Param( "reqRecord" )ReqRecord reqRecord);
    void addFriend(@Param( "friendId" )String friendId,@Param( "userId" )String userId);
    String isFriend(@Param( "friendId" )String friendId,@Param( "userId" )String userId);
    void updateAvatar(@Param( "userId")String userId,@Param( "avatarPath" )String avatarPath);

    void register(@Param( "userId" ) String userId,@Param( "password" ) String password,@Param("userName") String userName);

    void updateUser(@Param( "user" ) User user);

    void updatePassword(@Param( "newPassword" )String password);

    void changePassword(@Param( "eid" ) int eid, @Param( "newPassword" ) String newPassword);

    void deleteFriend(@Param( "userId" ) String userId,@Param( "friendId" ) String friendId);

    void updateUserStatus(@Param( "userId" )String userId,@Param( "status" )String status);

    void updateFriendRemark(@Param( "userId" )String userId,@Param( "friendId" )String friendId,@Param( "remark" )String remark);

    List<String> getUserAvatarPathList();
}
